#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPixmap>
#include <QImage>
#include <QDesktopWidget>
#include <QTime>
#include <QPaintEvent>
#include <QPainter>

#include "form.h"

#include <iostream>
using namespace std;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    void paintEvent(QPaintEvent *);
    Form show1;

    void combineImage(QImage src);

    void combindImageDetail(QImage src);

    int detectOverlap(QImage src);

    bool isSameLine(QImage img1, QImage img2, int h1, int h2);

private slots:
    void on_confirm_clicked();

    void on_cut_clicked();

    void on_save_clicked();

    void on_cut2_clicked();

    void on_mode_clicked();

private:
    Ui::MainWindow *ui;
    int clickTimes;
    QImage pic;
    bool mode0;

    int initx;
    int inity;
};

#endif // MAINWINDOW_H
